import {createRouter, createWebHistory} from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
    {
        path: '/',
        name: 'home',
        component: HomeView,
        redirect:"/list",
        children: [{
            path: '/list',
            component: () => import( '../views/ListView.vue')
        }, {
            path: '/detail',
            component: () => import( '../views/DetailView.vue')
        }, {
            path: '/result',
            component: () => import( '../views/ResultView.vue')
        }, {
            path: '/emp-list',
            component: () => import( '../views/EmpListView.vue')
        }, {
            path: '/emp-list2',
            component: () => import( '../views/EmpListView2.vue')
        }]
    },
    {
        path: '/reg',
        component: () => import( '../views/RegView.vue')
    },
    {
        path: '/login',
        component: () => import( '../views/LoginView.vue')
    }
]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router
